package com.github.data_manage

import com.github.data_manage.util.ExcelUtils
import org.apache.poi.xssf.usermodel.XSSFWorkbook
import org.junit.jupiter.api.Test
import java.nio.file.Paths
import java.nio.file.StandardOpenOption
import kotlin.io.path.inputStream

/**
 *
 * @author chenhainan
 * @since 2025/9/2
 */
class ExcelPercentTests {

    @Test
    fun excelPercentTest() {
        Paths.get("/Users/chenhainan/Downloads/测试.xlsx")
            .inputStream(StandardOpenOption.READ)
            .use { fis ->
                XSSFWorkbook(fis).use { workbook ->
                    val sheet = workbook.getSheetAt(0)
                    val cell = sheet.getRow(1).getCell(0)
                    println(ExcelUtils.getFormatStringCellValueFromCell(cell))
                    println(cell.numericCellValue)
                }
            }
    }

}